/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xlsBeans;

import com.smartxls.WorkBook;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Lucas
 */
public class SpecimenXLS {
    private boolean delete;
    private boolean private1;
    private MainFieldsXLS main;
    private RecordLevelElementsXLS rec;
    private TaxonomicElementsXLS tax;
    private OccurrenceElementsXLS occ;
    private IdentificationElementsXLS id;
    private EventElementsXLS eve;
    private LocalityElementsXLS loc;
    private GeospatialElementsXLS geo;

    private int sp;  //0 ou 110

    public SpecimenXLS(){
        this.main = new MainFieldsXLS();
        this.rec = new RecordLevelElementsXLS();
        this.tax = new TaxonomicElementsXLS();
        this.occ = new OccurrenceElementsXLS();
        this.id = new IdentificationElementsXLS();
        this.eve = new EventElementsXLS();
        this.loc = new LocalityElementsXLS();
        this.geo = new GeospatialElementsXLS();

    }

    public SpecimenXLS(MainFieldsXLS main, RecordLevelElementsXLS rec, TaxonomicElementsXLS tax, OccurrenceElementsXLS occ, IdentificationElementsXLS id, EventElementsXLS eve, LocalityElementsXLS loc, GeospatialElementsXLS geo, int sp) {
        this.main = main;
        this.rec = rec;
        this.tax = tax;
        this.occ = occ;
        this.id = id;
        this.eve = eve;
        this.loc = loc;
        this.geo = geo;
        this.sp = sp==1?0:110;
    }
    public SpecimenXLS(WorkBook w, int l, int sp){
        this.sp = sp==1?0:110;
        try {
            this.delete = w.getText(l, 0+this.sp).equals("YES");
            this.private1 = w.getText(l, 1+this.sp).equals("YES");
        } catch (Exception ex) {
            Logger.getLogger(SpecimenXLS.class.getName()).log(Level.SEVERE, null, ex);
        }
        this.main = new MainFieldsXLS(w,l,this.sp);
        this.rec = new RecordLevelElementsXLS(w, l, this.sp);
        this.tax = new TaxonomicElementsXLS(w, l, this.sp);
        this.occ = new OccurrenceElementsXLS(w, l, this.sp);
        this.id = new IdentificationElementsXLS(w, l, this.sp);
        this.eve = new EventElementsXLS(w, l, this.sp);
        this.loc = new LocalityElementsXLS(w, l, this.sp);
        this.geo = new GeospatialElementsXLS(w, l, this.sp);
    }

    public boolean isSet(){
        if(main.isSetMain() || tax.isSetTaxonomic() || rec.isSetRecord() || occ.isSetOccurence() || id.isSetIdentification() || eve.isSetEvent() || loc.isSetLocal() || geo.isSetGeo())
            return  true;
        else return false;
    }



    public EventElementsXLS getEve() {
        return eve;
    }

    public void setEve(EventElementsXLS eve) {
        this.eve = eve;
    }

    public GeospatialElementsXLS getGeo() {
        return geo;
    }

    public void setGeo(GeospatialElementsXLS geo) {
        this.geo = geo;
    }

    public IdentificationElementsXLS getId() {
        return id;
    }

    public void setId(IdentificationElementsXLS id) {
        this.id = id;
    }

    public LocalityElementsXLS getLoc() {
        return loc;
    }

    public void setLoc(LocalityElementsXLS loc) {
        this.loc = loc;
    }

    public MainFieldsXLS getMain() {
        return main;
    }

    public void setMain(MainFieldsXLS main) {
        this.main = main;
    }

    public OccurrenceElementsXLS getOcc() {
        return occ;
    }

    public void setOcc(OccurrenceElementsXLS occ) {
        this.occ = occ;
    }

    public RecordLevelElementsXLS getRec() {
        return rec;
    }

    public void setRec(RecordLevelElementsXLS rec) {
        this.rec = rec;
    }

    public TaxonomicElementsXLS getTax() {
        return tax;
    }

    public void setTax(TaxonomicElementsXLS tax) {
        this.tax = tax;
    }

    public void setSp(int sp) {
        this.sp = sp==1?0:110;
    }

    public boolean  getDelete() {
        return delete;
    }

    public void setDelete(boolean delete) {
        this.delete = delete;
    }

    public boolean getPrivate1() {
        return private1;
    }

    public void setPrivate1(boolean private1) {
        this.private1 = private1;
    }


}
